package cn.kailangtu.myapplication.tools;

import android.widget.TextView;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class FomaterUtils {
    public static String format2f(float source,String unit)
    {
        return String.format("%.2f"+unit,source);
    }



    public static String get星期()
    {
        Calendar calendar = Calendar.getInstance();
        int day = calendar.get(Calendar.DAY_OF_WEEK);
        String dayStr;
        switch (day) {
            case Calendar.SUNDAY:
                dayStr = "星期日";
                break;
            case Calendar.MONDAY:
                dayStr = "星期一";
                break;
            case Calendar.TUESDAY:
                dayStr = "星期二";
                break;
            case Calendar.WEDNESDAY:
                dayStr = "星期三";
                break;
            case Calendar.THURSDAY:
                dayStr = "星期四";
                break;
            case Calendar.FRIDAY:
                dayStr = "星期五";
                break;
            case Calendar.SATURDAY:
                dayStr = "星期六";
                break;
            default:
                dayStr = "";
        }
        return dayStr;
    }
}
